package monitora.dao;

import java.io.Serializable;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class Sessao implements Serializable {

	public static SessionFactory getSessionFactory() {
		try {
			AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration();
			annotationConfiguration.configure("hibernate_monitora.cfg.xml");
			
			return annotationConfiguration.buildSessionFactory();
		} catch (Exception exception) {
			exception.printStackTrace();
		}
		return null;
	}
}
